﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShowDoc.aspx.cs" Inherits="UpdateApp.ShowDoc" ValidateRequest="false" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="JavaScript-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
    <title>生成注释</title>
    <link href="CSS/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet" />
    <link href="/JavaScript/umeditor1_2_2-utf8-net/themes/default/css/umeditor.css" type="text/css" rel="stylesheet" />
    <style>
        .font {
            margin: 10px 50px;
            width: 8rem;
            font-size: 2rem;
        }
    </style>
</head>

<script src="JavaScript/JQuery-1.9.1.min.js"></script>
<script src="CSS/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>

<script type="text/javascript" charset="utf-8" src="/JavaScript/umeditor1_2_2-utf8-net/umeditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/JavaScript/umeditor1_2_2-utf8-net/umeditor.min.js"></script>
<script type="text/javascript" src="/JavaScript/umeditor1_2_2-utf8-net/lang/zh-cn/zh-cn.js"></script>

<body>
    <form id="aspnetForm" runat="server" enctype="multipart/form-data">
        <div class="container">
            <div class="row">
                <button type="button" class="btn btn-default font" onclick='window.location.href = "Default.aspx"'>返回</button>
            </div>
            <div class="row" style="margin-top: 1rem">
                <div class="col-md-4  col-md-offset-1">
                    <div class="form-inline">
                        <label for="reqParams">接口路径：</label>
                        <input runat="server" type="text" value="{{host}}/api" class="form-control" id="host" placeholder="为空会生成默认路径" />
                    </div>
                    <div class="form-inline" style="margin-top:1rem">
                        <label for="reqParams">请求参数：</label>
                        <input runat="server" type="text" value="1" class="form-control" id="reqParams" placeholder="字段的索引名或名称，保存接口写需要注释的字段" />
                    </div>
                    <div class="form-group">
                        <label for="baseParams">基础数据</label>
                        <input runat="server" type="text" class="form-control" id="baseParams" placeholder="为空则返回全部字段，-1 不返回字段" />
                    </div>
                    <div class="form-group">
                        <label for="baseParams">列表数据</label>
                        <input runat="server" type="text" class="form-control" id="listParams" placeholder="为空则返回全部字段，-1 不返回字段" />
                    </div>
                    <div class="form-group">
                        <label for="baseParams">详情数据</label>
                        <input runat="server" type="text" class="form-control" id="detailParams" placeholder="为空则返回全部字段，-1 不返回字段" />
                    </div>
                    <div class="form-group">
                        <label for="baseParams">保存数据</label>
                        <input runat="server" type="text" value="1,2,3,4,5,6" class="form-control" id="saveParams" placeholder="需要生成注释的参数列索引，一般用于必输项" />
                    </div>
                    <div class="checkbox">
                        <label>
                            <input runat="server" type="checkbox" id="Notes" value="1" />
                            是否只生成含有注释的属性
                        </label>
                        <label>
                            <input runat="server" type="checkbox" id="Num" value="1" />
                            是否只生成数值型的字段说明
                        </label>
                    </div>
                    <div class="form-group" style="display: flex">
                        <%--flex:1 平分元素--%>
                        <div style="flex: 1; text-align: start">
                            <button type="submit" id="create-btn" class="btn btn-success" style="width: 15rem">生成</button>
                        </div>
                        <div style="text-align: end">
                            <button type="button" id="edit-btn" onclick="window.location.href='Template.aspx?file=ShowDoc'" class="btn btn-info" style="width: 15rem">编辑模板</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <%--col-md-offset-1 向右偏移--%>
                <div class="col-md-4 col-md-offset-1" style="margin-top: 0.5rem">
                    <div style="display: flex">
                        <a style="flex: 1; align-items: flex-start" href="/Upload/Alway/showdoc_api.sh">ShowDoc脚本下载</a>
                        <a style="align-items: flex-end" href="http://show.zx3315.cn/web/#/17" target="_blank">默认接口文档</a>
                    </div>
                </div>
            </div>
            <div class="row" style="margin-top: 0.5rem">
                <div class="col-md-10 col-md-offset-1">
                    <div>
                        * 在ShowDoc或RunApi中创建项目，查看项目密钥
                    </div>
                    <div>
                        * 修改脚本中的项目密钥，将脚本放在接口目录中执行（需要git环境）
                    </div>
                    <div>
                        * 若不改项目密钥将在默认接口文档中生成，可参看注释说明自行修改注释格式
                    </div>
                    <div>
                        * <a href="/Upload/Alway/showdoc1.0.3-win.zip">ShowDoc</a>和<a href="/Upload/Alway/runapi1.0.7.zip">RunApi</a>，可使用私服务器：show.zx3315.cn，没有项目数量的限制
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-15" style="margin-top: 2rem">
                    <script type="text/plain" id="myEditor" style="width: 90%;"><%=Content %></script>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
<script>

    window.UMEDITOR_CONFIG = {
        toolbar: ['source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |', 'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize',
            '| justifyleft justifycenter justifyright justifyjustify |', '| horizontal print preview fullscreen']
    }

    //实例化编辑器
    var um = UM.getEditor('myEditor', window.UMEDITOR_CONFIG);

</script>
